home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 3 / CD ACTUAL 3.iso / linux / system / xmailbox.2-s / xmailbox / xmailbox-2.2 / MailboxP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-17  |  3.9 KB  |  106 lines

  1. /*
  2.  * Copyright (c) 1994,1995  Dimitrios P. Bouras and William K. W. Cheung
  3.  * 
  4.  * Permission is hereby granted, free of charge, to any person obtaining a copy
  5.  * of this software and associated documentation files (the "Software"), to deal
  6.  * in the Software without restriction, including without limitation the rights
  7.  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8.  * copies of the Software, and to permit persons to whom the Software is
  9.  * furnished to do so, subject to the following conditions:
  10.  * 
  11.  * The above copyright notice and this permission notice shall be included in
  12.  * all copies or substantial portions of the Software.
  13.  * 
  14.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16.  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  17.  * X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  18.  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  19.  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  20.  * 
  21.  * Except as contained in this notice, the name of the X Consortium shall not be
  22.  * used in advertising or otherwise to promote the sale, use or other dealings
  23.  * in this Software without prior written authorization from the X Consortium.
  24.  * 
  25.  * Derived from the MIT X11R5 xbiff, written by Jim Fulton, which is
  26.  * copyrighted (c) 1988 X Consortium.
  27.  *
  28.  * Mailbox XPM additions-modifications:  Dimitrios P. Bouras
  29.  * Audio support and XPM icon animation: William K. W. Cheung
  30.  *
  31.  */
  32.  
  33.  
  34. #ifndef _Mailbox_XPM_P_h
  35. #define _Mailbox_XPM_P_h
  36.  
  37. #include "Mailbox.h"
  38. #include <X11/Xaw/SimpleP.h>
  39. #include <xpm.h>
  40.  
  41. #ifdef SYSV
  42. #define MAILBOX_DIRECTORY "/usr/mail"
  43. #else
  44. #ifdef SVR4
  45. #define MAILBOX_DIRECTORY "/var/mail"
  46. #else
  47. #define MAILBOX_DIRECTORY "/usr/spool/mail"
  48. #endif
  49. #endif
  50.  
  51. typedef struct {                /* new fields for mailbox widget */
  52.     /* resources */
  53.     int update;                    /* seconds between updates */
  54.     String filename;            /* filename to watch */
  55.     String check_command;        /* command to exec for mail check */
  56.     int volume;                    /* bell volume */
  57.     Boolean once_only;            /* ring bell only once on new mail */
  58.     int mail_animupdate;        /* milliseconds between update */
  59.     Boolean mail_animonce;        /* Once show animation once */
  60.     int mail_numofxpmfile;        /* number of icons for mail animation */
  61.     String mail_tool;            /* mail app when mail in above file */
  62.     String mail_xpmfile;        /* xpm icon when mail in above file */
  63.     String mail_sndfile;        /* xpm sound when mail in above file */
  64.     String nomail_xpmfile;        /* and for the case of no mail */
  65.     
  66.     /* local state */
  67.     GC gc;                        /* normal GC to use */
  68.     long last_size;                /* size in bytes of mailboxname */
  69.     XtIntervalId interval_id;    /* time between checks */
  70.     XtIntervalId anim_int_id;    /* time between changing icon */
  71.     int anim_id;                /* current displaying icon */
  72.     int first_trig;                /* Trigger the first time */
  73.     Boolean flag_up;            /* is the flag up? */
  74.     struct _mbimage {
  75.         Pixmap bitmap;            /* depth 1, describing shape */
  76.         Pixmap pixmap;            /* full depth pixmap */
  77.         XpmImage *xpmimg;        /* the xpm image */
  78.         int width, height;        /* geometry of pixmaps */
  79.     } full[MAX_ANIM_IMAGE], empty;
  80.     struct {
  81.         Pixmap mask;
  82.         int x, y;
  83.     } shape_cache;            /* last set of info */
  84. } Mailbox_XPM_Part;
  85.  
  86. typedef struct _Mailbox_XPM_Rec {    /* full instance record */
  87.     CorePart core;
  88.     SimplePart simple;
  89.     Mailbox_XPM_Part mailbox;
  90. } Mailbox_XPM_Rec;
  91.  
  92.  
  93. typedef struct {            /* new fields for mailbox class */
  94.     int dummy;                /* stupid C compiler */
  95. } Mailbox_XPM_ClassPart;
  96.  
  97. typedef struct _Mailbox_XPM_ClassRec {    /* full class record declaration */
  98.     CoreClassPart core_class;
  99.     SimpleClassPart simple_class;
  100.     Mailbox_XPM_ClassPart mailbox_class;
  101. } Mailbox_XPM_ClassRec;
  102.  
  103. extern Mailbox_XPM_ClassRec mailboxClassRec;     /* class pointer */
  104.  
  105. #endif /* _Mailbox_XPM_P_h */
  106.